package com.googlecode.nls4j;

import java.util.EventListener;
import java.util.Locale;

/**
 * LocaleChangeListeners are called each time when the locale of the listening
 * {@linkplain NlsContext} has changed.
 * 
 * @author Andrey Pavlenko
 */
public interface LocaleChangeListener extends EventListener {

    /**
     * This method is called each time when the locale of the listening
     * {@linkplain NlsContext} has changed.
     * 
     * @param context
     *            the listening NlsContext whose locale has changed.
     * @param oldLocale
     *            previous locale.
     * @param newLocale
     *            new locale.
     * @param handback
     *            the object passed to the NlsContext during
     *            {@linkplain NlsContext#addLocaleChangeListener(LocaleChangeListener, Object)
     *            registration}.
     */
    public void handleLocaleChange(NlsContext context, Locale oldLocale,
            Locale newLocale, Object handback);
}
